{include file='public/head'}
<body>
<div class="x-body">
    <form class="layui-form" id='mainForm' method="post" action="workOrderEdit">

        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
            <tr>
                <td>工单标题</td>
                <td>{$info.title}</td>
            </tr>
            <tr>
                <td>问题类型</td>
                <td>{$info.category}</td>
            </tr>
            <tr>
                <td>处理进度</td>
                <td>{$info.state}</td>
            </tr>
            <tr>
                <td>追踪号</td>
                <td>{$info.tracking_number}</td>
            </tr>
            <tr>
                <td>参考号</td>
                <td>{$info.reference_number}</td>
            </tr>
            <tr>
                <td>订单编号</td>
                <td>{$info.order_number}</td>
            </tr>
            <tr>
                <td>AE单号</td>
                <td>{$info.logistics_number}</td>
            </tr>
            <tr>
                <td>运输方式</td>
                <td>{$info.transport}</td>
            </tr>
            <tr>
                <td>处理期限</td>
                <td>{$info['deadline']|date="Y-m-d",###}</td>
            </tr>
            <tr>
                <td>提交对象</td>
                <td>
                    {if $info.commit == 1}
                    当前公司
                    {else/}
                    总公司
                    {/if}
                </td>
            </tr>
            <tr>
                <td>备注</td>
                <td>{$info.remark}</td>
            </tr>
            <tr>
                <td>回复信息</td>
                <td>
                    {volist name="reply" id="vo"}
                    <span style="color: #1E9FFF">{$vo.truename}&nbsp;&nbsp;{$vo['timestamp']|date="Y-m-d H:i:s",###}</span><br/>
                    {$vo.content}<br/>
                    {/volist}
                </td>
            </tr>
            {if $info.status == 1 || $info.status == 2}
            <tr>
                <td><b style="color:red">*</b>添加回复</td>
                <td>
                    <textarea name="content" lay-verify="required" class="layui-textarea"></textarea>
                </td>
            </tr>
            {/if}
            </tbody>
        </table>
        {if $info.status == 1 || $info.status == 2}
        <div class="layui-form-item">
            <div>
                <input type="hidden" id="id" name="id" value="{$info.id}">
                <button style="width: 100%" class="layui-btn" lay-submit="" lay-filter="toSubmit">提交保存</button>
            </div>
        </div>
        {/if}
    </form>
</div>
</body>
{include file='public/foot'}
<script type="text/javascript">

    $(document).ready(function () {
        var form = layui.form;
        var layer = layui.layer;
        var options = {
            type: 'post',           //post提交
            dataType: "json",        //json格式
            data: {},    //如果需要提交附加参数，视情况添加
            clearForm: false,        //成功提交后，清除所有表单元素的值
            resetForm: false,        //成功提交后，重置所有表单元素的值
            cache: false,
            async: false,          //同步返回
            success: function (data) {
                if (data.code == 0) {
                    layer.msg(data.msg);
                } else {
                    layer.msg(data.msg, {icon: 1, time: 500}, function () {
                        x_admin_close();
                        parent.location.reload();
                    });
                }
                //服务器端返回处理逻辑
            },
            error: function (XmlHttpRequest, textStatus, errorThrown) {
                layer.msg('操作失败:服务器处理失败');
            }
        };

        // bind form using 'ajaxForm'
        $('#mainForm').ajaxForm(options).submit(function (data) {
        });
    });
</script>
</html>
